#include "common.hpp"

int main()
{
    int fd = open(fifo_file.c_str(),O_WRONLY);
    if(fd == -1)
    {
        cout << "文件打开失败"<< errno << strerror(errno) ;
        return -1;
    }
    cout << "准备通信 我的pid是:" <<getpid() <<endl;
    while(true)
    {
        char buffer[1024] = {0};
        gets(buffer);
        ssize_t count =  write(fd,buffer,sizeof(buffer)-1);
        if(count <= 0)
        {
            break;
        }
    }
    unlink(fifo_file.c_str());
    return 0;
}
